Integrand size = 35, antiderivative size = 118 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=\frac {\sqrt {2} (A-B+C) \text {arctanh}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {2} \sqrt {a+a \cos (c+d x)}}\right )}{\sqrt {a} d}+\frac {2 (3 B-2 C) \sin (c+d x)}{3 d \sqrt {a+a \cos (c+d x)}}+\frac {2 C \sqrt {a+a \cos (c+d x)} \sin (c+d x)}{3 a d} \]
(A-B+C)*arctanh(1/2*sin(d*x+c)*a^(1/2)*2^(1/2)/(a+a*cos(d*x+c))^(1/2))*2^( 1/2)/d/a^(1/2)+2/3*(3*B-2*C)*sin(d*x+c)/d/(a+a*cos(d*x+c))^(1/2)+2/3*C*sin (d*x+c)*(a+a*cos(d*x+c))^(1/2)/a/d
Time = 0.15 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.67 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=\frac {2 \cos \left (\frac {1}{2} (c+d x)\right ) \left (3 (A-B+C) \text {arctanh}\left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+6 B \sin \left (\frac {1}{2} (c+d x)\right )-4 C \sin ^3\left (\frac {1}{2} (c+d x)\right )\right )}{3 d \sqrt {a (1+\cos (c+d x))}} \]
(2*Cos[(c + d*x)/2]*(3*(A - B + C)*ArcTanh[Sin[(c + d*x)/2]] + 6*B*Sin[(c + d*x)/2] - 4*C*Sin[(c + d*x)/2]^3))/(3*d*Sqrt[a*(1 + Cos[c + d*x])])
Time = 0.52 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.07, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.229, Rules used = {3042, 3502, 27, 3042, 3230, 3042, 3128, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{\sqrt {a \cos (c+d x)+a}} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\sqrt {a \sin \left (c+d x+\frac {\pi }{2}\right )+a}}dx\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \frac {2 \int \frac {a (3 A+C)+a (3 B-2 C) \cos (c+d x)}{2 \sqrt {\cos (c+d x) a+a}}dx}{3 a}+\frac {2 C \sin (c+d x) \sqrt {a \cos (c+d x)+a}}{3 a d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\int \frac {a (3 A+C)+a (3 B-2 C) \cos (c+d x)}{\sqrt {\cos (c+d x) a+a}}dx}{3 a}+\frac {2 C \sin (c+d x) \sqrt {a \cos (c+d x)+a}}{3 a d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a (3 A+C)+a (3 B-2 C) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right ) a+a}}dx}{3 a}+\frac {2 C \sin (c+d x) \sqrt {a \cos (c+d x)+a}}{3 a d}\) |
\(\Big \downarrow \) 3230 |
\(\displaystyle \frac {3 a (A-B+C) \int \frac {1}{\sqrt {\cos (c+d x) a+a}}dx+\frac {2 a (3 B-2 C) \sin (c+d x)}{d \sqrt {a \cos (c+d x)+a}}}{3 a}+\frac {2 C \sin (c+d x) \sqrt {a \cos (c+d x)+a}}{3 a d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {3 a (A-B+C) \int \frac {1}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right ) a+a}}dx+\frac {2 a (3 B-2 C) \sin (c+d x)}{d \sqrt {a \cos (c+d x)+a}}}{3 a}+\frac {2 C \sin (c+d x) \sqrt {a \cos (c+d x)+a}}{3 a d}\) |
\(\Big \downarrow \) 3128 |
\(\displaystyle \frac {\frac {2 a (3 B-2 C) \sin (c+d x)}{d \sqrt {a \cos (c+d x)+a}}-\frac {6 a (A-B+C) \int \frac {1}{2 a-\frac {a^2 \sin ^2(c+d x)}{\cos (c+d x) a+a}}d\left (-\frac {a \sin (c+d x)}{\sqrt {\cos (c+d x) a+a}}\right )}{d}}{3 a}+\frac {2 C \sin (c+d x) \sqrt {a \cos (c+d x)+a}}{3 a d}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\frac {3 \sqrt {2} \sqrt {a} (A-B+C) \text {arctanh}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {2} \sqrt {a \cos (c+d x)+a}}\right )}{d}+\frac {2 a (3 B-2 C) \sin (c+d x)}{d \sqrt {a \cos (c+d x)+a}}}{3 a}+\frac {2 C \sin (c+d x) \sqrt {a \cos (c+d x)+a}}{3 a d}\) |
(2*C*Sqrt[a + a*Cos[c + d*x]]*Sin[c + d*x])/(3*a*d) + ((3*Sqrt[2]*Sqrt[a]* (A - B + C)*ArcTanh[(Sqrt[a]*Sin[c + d*x])/(Sqrt[2]*Sqrt[a + a*Cos[c + d*x ]])])/d + (2*a*(3*B - 2*C)*Sin[c + d*x])/(d*Sqrt[a + a*Cos[c + d*x]]))/(3* a)
3.5.4.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[-2/d Subst[Int[1/(2*a - x^2), x], x, b*(Cos[c + d*x]/Sqrt[a + b*Sin[c + d*x]])], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/( f*(m + 1))), x] + Simp[(a*d*m + b*c*(m + 1))/(b*(m + 1)) Int[(a + b*Sin[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && !LtQ[m, -2^(-1)]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
Leaf count of result is larger than twice the leaf count of optimal. \(232\) vs. \(2(101)=202\).
Time = 8.18 (sec) , antiderivative size = 233, normalized size of antiderivative = 1.97
method | result | size |
default | \(\frac {\cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (-4 C \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+3 A \ln \left (\frac {4 \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+4 a}{\cos \left (\frac {d x}{2}+\frac {c}{2}\right )}\right ) a +6 B \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}-3 B \ln \left (\frac {4 \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+4 a}{\cos \left (\frac {d x}{2}+\frac {c}{2}\right )}\right ) a +3 C \ln \left (\frac {4 \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+4 a}{\cos \left (\frac {d x}{2}+\frac {c}{2}\right )}\right ) a \right )}{3 a^{\frac {3}{2}} \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, d}\) | \(233\) |
parts | \(\frac {A \sqrt {2}\, \operatorname {am}^{-1}\left (\frac {d x}{2}+\frac {c}{2}| 1\right )}{d \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \operatorname {csgn}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {B \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (-\sqrt {2}\, \ln \left (\frac {4 \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+4 a}{\cos \left (\frac {d x}{2}+\frac {c}{2}\right )}\right ) a +2 \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}\right )}{a^{\frac {3}{2}} \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, d}+\frac {C \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (-4 \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}\, \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+3 \sqrt {2}\, \ln \left (\frac {4 \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+4 a}{\cos \left (\frac {d x}{2}+\frac {c}{2}\right )}\right ) a \right )}{3 a^{\frac {3}{2}} \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, d}\) | \(316\) |
1/3*cos(1/2*d*x+1/2*c)*2^(1/2)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)*(-4*C*a^(1/2 )*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)*sin(1/2*d*x+1/2*c)^2+3*A*ln(4*(a^(1/2)*(a *sin(1/2*d*x+1/2*c)^2)^(1/2)+a)/cos(1/2*d*x+1/2*c))*a+6*B*(a*sin(1/2*d*x+1 /2*c)^2)^(1/2)*a^(1/2)-3*B*ln(4*(a^(1/2)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)+a) /cos(1/2*d*x+1/2*c))*a+3*C*ln(4*(a^(1/2)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)+a) /cos(1/2*d*x+1/2*c))*a)/a^(3/2)/sin(1/2*d*x+1/2*c)/(a*cos(1/2*d*x+1/2*c)^2 )^(1/2)/d
Time = 0.28 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.28 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=\frac {4 \, {\left (C \cos \left (d x + c\right ) + 3 \, B - C\right )} \sqrt {a \cos \left (d x + c\right ) + a} \sin \left (d x + c\right ) + \frac {3 \, \sqrt {2} {\left ({\left (A - B + C\right )} a \cos \left (d x + c\right ) + {\left (A - B + C\right )} a\right )} \log \left (-\frac {\cos \left (d x + c\right )^{2} - \frac {2 \, \sqrt {2} \sqrt {a \cos \left (d x + c\right ) + a} \sin \left (d x + c\right )}{\sqrt {a}} - 2 \, \cos \left (d x + c\right ) - 3}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right )}{\sqrt {a}}}{6 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}} \]
1/6*(4*(C*cos(d*x + c) + 3*B - C)*sqrt(a*cos(d*x + c) + a)*sin(d*x + c) + 3*sqrt(2)*((A - B + C)*a*cos(d*x + c) + (A - B + C)*a)*log(-(cos(d*x + c)^ 2 - 2*sqrt(2)*sqrt(a*cos(d*x + c) + a)*sin(d*x + c)/sqrt(a) - 2*cos(d*x + c) - 3)/(cos(d*x + c)^2 + 2*cos(d*x + c) + 1))/sqrt(a))/(a*d*cos(d*x + c) + a*d)
\[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=\int \frac {A + B \cos {\left (c + d x \right )} + C \cos ^{2}{\left (c + d x \right )}}{\sqrt {a \left (\cos {\left (c + d x \right )} + 1\right )}}\, dx \]
Leaf count of result is larger than twice the leaf count of optimal. 38474 vs. \(2 (101) = 202\).
Time = 0.97 (sec) , antiderivative size = 38474, normalized size of antiderivative = 326.05 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=\text {Too large to display} \]
1/60*(30*(sqrt(2)*log(cos(1/2*d*x + 1/2*c)^2 + sin(1/2*d*x + 1/2*c)^2 + 2* sin(1/2*d*x + 1/2*c) + 1) - sqrt(2)*log(cos(1/2*d*x + 1/2*c)^2 + sin(1/2*d *x + 1/2*c)^2 - 2*sin(1/2*d*x + 1/2*c) + 1))*A/sqrt(a) + (20*(cos(d*x + c) + 1)*sin(5/2*d*x + 5/2*c)^3 + 8*(cos(d*x + c)^2 + sin(d*x + c)^2 + 2*cos( d*x + c) + 1)*sin(3/2*d*x + 3/2*c)^3 - 20*cos(5/2*d*x + 5/2*c)^3*sin(d*x + c) + 2*(15*(log(cos(1/2*d*x + 1/2*c)^2 + sin(1/2*d*x + 1/2*c)^2 + 2*sin(1 /2*d*x + 1/2*c) + 1) - log(cos(1/2*d*x + 1/2*c)^2 + sin(1/2*d*x + 1/2*c)^2 - 2*sin(1/2*d*x + 1/2*c) + 1))*cos(d*x + c)^2 + 15*(log(cos(1/2*d*x + 1/2 *c)^2 + sin(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c) + 1) - log(cos(1/2 *d*x + 1/2*c)^2 + sin(1/2*d*x + 1/2*c)^2 - 2*sin(1/2*d*x + 1/2*c) + 1))*si n(d*x + c)^2 + 30*(log(cos(1/2*d*x + 1/2*c)^2 + sin(1/2*d*x + 1/2*c)^2 + 2 *sin(1/2*d*x + 1/2*c) + 1) - log(cos(1/2*d*x + 1/2*c)^2 + sin(1/2*d*x + 1/ 2*c)^2 - 2*sin(1/2*d*x + 1/2*c) + 1))*cos(d*x + c) + 4*(cos(d*x + c)^2 + s in(d*x + c)^2 + 2*cos(d*x + c) + 1)*sin(3/2*d*x + 3/2*c) - 20*cos(3/2*d*x + 3/2*c)*sin(d*x + c) + 15*log(cos(1/2*d*x + 1/2*c)^2 + sin(1/2*d*x + 1/2* c)^2 + 2*sin(1/2*d*x + 1/2*c) + 1) - 15*log(cos(1/2*d*x + 1/2*c)^2 + sin(1 /2*d*x + 1/2*c)^2 - 2*sin(1/2*d*x + 1/2*c) + 1))*cos(5/2*d*x + 5/2*c)^2 + 30*((log(cos(1/2*d*x + 1/2*c)^2 + sin(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c) + 1) - log(cos(1/2*d*x + 1/2*c)^2 + sin(1/2*d*x + 1/2*c)^2 - 2*sin (1/2*d*x + 1/2*c) + 1))*cos(d*x + c)^2 + (log(cos(1/2*d*x + 1/2*c)^2 + ...
Time = 0.34 (sec) , antiderivative size = 159, normalized size of antiderivative = 1.35 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=\frac {\frac {3 \, \sqrt {2} {\left (A \sqrt {a} - B \sqrt {a} + C \sqrt {a}\right )} \log \left (\sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} - \frac {3 \, \sqrt {2} {\left (A \sqrt {a} - B \sqrt {a} + C \sqrt {a}\right )} \log \left (-\sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} - \frac {4 \, \sqrt {2} {\left (2 \, C a^{\frac {5}{2}} \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, B a^{\frac {5}{2}} \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{a^{3} \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{6 \, d} \]
1/6*(3*sqrt(2)*(A*sqrt(a) - B*sqrt(a) + C*sqrt(a))*log(sin(1/2*d*x + 1/2*c ) + 1)/(a*sgn(cos(1/2*d*x + 1/2*c))) - 3*sqrt(2)*(A*sqrt(a) - B*sqrt(a) + C*sqrt(a))*log(-sin(1/2*d*x + 1/2*c) + 1)/(a*sgn(cos(1/2*d*x + 1/2*c))) - 4*sqrt(2)*(2*C*a^(5/2)*sin(1/2*d*x + 1/2*c)^3 - 3*B*a^(5/2)*sin(1/2*d*x + 1/2*c))/(a^3*sgn(cos(1/2*d*x + 1/2*c))))/d
Time = 1.69 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.75 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=\frac {2\,B\,\left (2\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |1\right )-\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |1\right )\right )\,\sqrt {\frac {a+a\,\cos \left (c+d\,x\right )}{2\,a}}}{d\,\sqrt {a+a\,\cos \left (c+d\,x\right )}}+\frac {A\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |1\right )\,\sqrt {\frac {2\,\left (a+a\,\cos \left (c+d\,x\right )\right )}{a}}}{d\,\sqrt {a+a\,\cos \left (c+d\,x\right )}}+\frac {2\,C\,\sin \left (c+d\,x\right )\,\sqrt {a+a\,\cos \left (c+d\,x\right )}}{3\,a\,d}-\frac {2\,C\,\left (4\,a^2\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |1\right )-3\,a^2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |1\right )\right )\,\sqrt {\frac {a+a\,\cos \left (c+d\,x\right )}{2\,a}}}{3\,a^2\,d\,\sqrt {a+a\,\cos \left (c+d\,x\right )}} \]
(2*B*(2*ellipticE(c/2 + (d*x)/2, 1) - ellipticF(c/2 + (d*x)/2, 1))*((a + a *cos(c + d*x))/(2*a))^(1/2))/(d*(a + a*cos(c + d*x))^(1/2)) + (A*ellipticF (c/2 + (d*x)/2, 1)*((2*(a + a*cos(c + d*x)))/a)^(1/2))/(d*(a + a*cos(c + d *x))^(1/2)) + (2*C*sin(c + d*x)*(a + a*cos(c + d*x))^(1/2))/(3*a*d) - (2*C *(4*a^2*ellipticE(c/2 + (d*x)/2, 1) - 3*a^2*ellipticF(c/2 + (d*x)/2, 1))*( (a + a*cos(c + d*x))/(2*a))^(1/2))/(3*a^2*d*(a + a*cos(c + d*x))^(1/2))